package cloud.xlh.auth.controller;

import cloud.xlh.auth.domin.dto.UserInfoDTO;
import cloud.xlh.auth.service.LoginService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/1/15 20:48
 * @ Description: 登录
 */
@RestController
@RequestMapping("/auth/login")
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 登录
     */
    @RequestMapping("/login")
    public JSONObject login(@RequestBody UserInfoDTO userInfoDTO, HttpServletRequest request, HttpServletResponse response) {
        return loginService.login(userInfoDTO, request, response);
    }
}
